package com.aijk.commons.jedis;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import redis.clients.jedis.JedisPubSub;

/**
 * Created by iscdw on 2016/5/20.
 */
public class PubSub extends JedisPubSub {

    private final Logger logger = LoggerFactory.getLogger(PubSub.class);

    @Override
    public void onMessage(String channel, String message) {

        logger.info("onMessage: channel[{}], message[{}]", channel, message);

    }


    @Override
    public void onPMessage(String pattern, String channel, String message) {

        logger.info("onPMessage: channel[{}], message[{}]", channel, message);

    }


    @Override
    public void onSubscribe(String channel, int subscribedChannels) {

        logger.info("onSubscribe: channel[{}], subscribedChannels[{}]", channel, subscribedChannels);

    }


    @Override
    public void onUnsubscribe(String channel, int subscribedChannels) {

        logger.info("onUnsubscribe: channel[{}], subscribedChannels[{}]", channel, subscribedChannels);

    }


    @Override
    public void onPUnsubscribe(String pattern, int subscribedChannels) {

        logger.info("onPUnsubscribe: pattern[{}], subscribedChannels[{}]", pattern, subscribedChannels);

    }


    @Override
    public void onPSubscribe(String pattern, int subscribedChannels) {

        logger.info("onPSubscribe: pattern[{}],subscribedChannels[{}]", pattern, subscribedChannels);

    }

}
